package top.codingfly.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.codingfly.mapper.entity.AreaCodeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 * 行政区划表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-07-18
 */
@Mapper
public interface AreaCodeMapper extends BaseMapper<AreaCodeEntity> {

    List<AreaCodeEntity> selectTest();

    Integer maxSort(@Param("parentCode") String parentCode);

    List<AreaCodeEntity> selectListByParentCode(@Param("parentCode") String parentCode);

    /** 同父级排在前面那个 */
    AreaCodeEntity sortUpOne(@Param("parentCode") String parentCode, Integer sort);

    /** 同父级排在后面那个 */
    AreaCodeEntity sortDownOne(@Param("parentCode") String parentCode, Integer sort);

}
